//
// Created by 28365 on 2025/3/5.
//

#ifndef ODUPDATERSDK_UPDATINGEVENT_H
#define ODUPDATERSDK_UPDATINGEVENT_H

#include <fstream>
#include "UpdateEvent.h"

using namespace std;

class UpdatingEvent : public UpdateEvent{

private:
    /**
     * 资源文件总大小
     */
    size_t fileSize{};

    /**
     * 输出流(二进制)，如果 Res.isDelete()==true，该参数则为nullptr,此输出流更新完成后自动调用close()
     */
    ofstream *outStream{};

public:

    UpdatingEvent(const Res *res, int version, size_t fileSize, ofstream *outStream);

    [[nodiscard]] size_t getFileSize() const;

    [[nodiscard]] ofstream *getOutStream() const;

};


#endif //ODUPDATERSDK_UPDATINGEVENT_H
